﻿using GeneralDashboard.Data.Core;
using System;
using System.Collections.Generic;
using System.Text;

namespace GeneralDashboard.Data.Adaptor
{
    public abstract class AdaptorBase
    {
        public string Name { get; }

        public ProtocolBase Protocol { get; protected set; }

        public AdaptorBase(string name)
        {
            Name = name;
        }

        public abstract void Open();
        public abstract void Close();
        public abstract void Send(ReadOnlySpan<byte> data);
        public void Send(string msg)
        {
            Send(Encoding.ASCII.GetBytes(msg));
        }
    }
}
